package chapter04;

class  Person{
    private String name;
    private int age;

    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
class student extends Person{
    private double score;

    public student(String name, int age) {
        super(name, age);
        this.score = score;
    }

    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }

    @Override
    public String toString() {
        return "student{" +
                "score=" + score +
                '}';
    }
}
public class test05 {
    public static void main(String[] args) {
        Person[] people = new Person[5];
        people[0]=new Person("lrl0",16);
        people[1]=new Person("lrl1",12);
        people[2]=new Person("lrl2",14);
        people[3]=new Person("lrl3",13);
        people[0]=new student("sas",20);




    }
}
